package cn.edu.zzuli.nothinglink.entity;

import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * <p>
 * 
 * </p>
 *
 * @author suzyyy
 * @since 2021-04-22
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
public class Work implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = "work_id", type = IdType.AUTO)
    private Integer workId;

    /**
     * 所属课程号
     */
    private Integer courseId;

    /**
     * 创建者id
     */
    private Integer workTeaId;

    /**
     * 作业类型：1是文本，2是选择
     */
    private Integer workType;

    /**
     * 题干内容：1是文本，2是图片
     */
    private Integer contentType;

    /**
     * 题干内容为文本时候的具体信息
     */
    private String content;

    /**
     * 题干内容为图片时候的url地址
     */
    private String workImgUrl;

    /**
     * 作业名字，方便回显
     */
    private String workName;

    /**
     * 课程名字，方便回显
     */
    @TableField("course_name")
    private String courseName;

    /**
     * 作业分数
     */
    private Integer workScore;

    @TableField(exist = false)
    private Integer submitCount = 0;

    /**
     * 选择题每个选项的信息。isMuitlSelect为true代表是多项选择题，startHalfRightGetScore为true，代表多项选择题的时候开启半对得分
     */
    @TableField("check_infos")
    private String checkInfos;

    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime startTime;

    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime endTime;

    @TableField("is_end")
    private Integer end;

    @TableLogic
    private Integer deleted;

    //不用于数据库，用于数据回显
    @TableField(exist = false)
    @JSONField(name = "isMuitlSelect")
    private boolean isMuitlSelect = false;


}
